package edu.cmu.mism.dgjava.data.ui.composites;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Composite;

/**
 * The data composite is intended to be used by CommonParametersTypeBook as a
 * GUI representative of the typed parameters controls
 * 
 * @author Christian
 * 
 */
public abstract class AbstractDataComposite {

	protected ModifyListener _validator = new ModifyListener() {

		@Override
		public void modifyText(ModifyEvent e) {
			validate();
		}
	};

	/**
	 * @return the associated data object
	 */
	public Object getDataObject() {
		return null;
	}

	/**
	 * Creates the GUI controls for this composite
	 * 
	 * @param container
	 */
	public abstract void createControls(Composite container);

	/**
	 * hookup modify listener
	 */
	protected void hookupModifyListener() {
		// do nothing;
	}

	protected abstract void validate();
}
